package com.easy.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.sql.Connection;

import com.easy.bean.Repair;
import com.easy.util.JDBC;

public class RepairDao {
	public List<Repair> querList(String sql){
		try {
			return JDBC.queryList(sql, Repair.class);
		} catch (Exception e) {
			e.printStackTrace();
			return new ArrayList();
		}
	}
	
	public Repair query(String sql){
		try {
			return JDBC.query(sql, Repair.class);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
	
	public int insert(String sql) {
		try {
			return JDBC.insert(sql);
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}
	}
	
	public List<Integer> insertlist(String sql) {
		try {
			return JDBC.insertlist(sql);
		} catch ( SQLException e) {
			e.printStackTrace();
			return null;
		}
	}
	
	public List<Integer> insertlist(Connection con,String sql) {
		try {
			return JDBC.insertlist(con,sql);
		} catch ( SQLException e) {
			e.printStackTrace();
			return null;
		}
	}
	
	public int update(String sql) {
		try {
			return JDBC.update(sql);
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}
	}
	
	public int delete(String sql) {
		try {
			return JDBC.update(sql);
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}
	}
	
	public int queryCount(String sql) {
		try {
			return JDBC.queryCount(sql);
		} catch (SQLException e) {
			e.printStackTrace();
			return 0;
		}
	}
}
